// import service from '../util/service'
// import Axios from 'axios'


// export function Login(username, password) {
//     // Qs.stringify({ username }, { username })
//     var params = new URLSearchParams()
//     params.append(username, username)
//     params.append(password, password)
//     return new Promise((resolve, reject) => {
//         Axios({
//             url: 'http://121.196.57.23:8080/user/login ',
//             method: 'POST',
//             data: params,
//             headers: {
//                 'Content-Type': 'application/json'
//             }
//         }).then((ok) => {
//             then(
//                 res => this.list = res.data
//             )
//             console.log("qqq" + ok)
//         })
//     })
// }


// import service from '../util/service.js'
import Axios from 'axios'


export function Login(username, password) {
    // Qs.stringify({ username }, { username })
    var params = { "username": username, "password": password };
    return new Promise((password, username) => {
        Axios({
            url: 'http://121.196.57.23:8080/user/login',
            method: 'POST',
            data: JSON.stringify(params),
            dataType: "json",
            headers: { Accept: "application/json,text/plain,*/*", "Content-Type": "application/json;charset = utf-8" },
        }).then((ok) => {
            (
                res => this.list = res.data
            )
        })
    })
}

// import service from "@/util/request.js"
// export function aaa(a,b) {
//   // let urlp = new URLSearchParams()
//   // urlp.append("username", a)
//   // urlp.append("password", b)
//   // console.log(urlp)
//   var params = {"username":a, "password":b};
//   return new Promise((res,rej)=>{
// service.request({
//   url:'/api/user/register',
//   method: "post",
//   dataType:"json",
//   // headers:"'Content-Type':'application/json';",
//   headers:{Accept:"application/json,text/plain,*/*","Content-Type":"application/json;charset = utf-8"},
//   data:JSON.stringify(params)

// }).then(ok=>{
//   res(ok)
//   console.log(ok)
// }).catch(err=>{
//   rej(err)
// })
//   })
// }